//=============================================================================
// Knife Inventory class
//=============================================================================
class KnifeNew extends SRMeleeGun;

function bool FoundBetterMelee()
{
	local Inventory I;
	
	for(I=Instigator.Inventory; I!=none; I=I.Inventory)
	{
		if ( Machete(I) != none || Katana(I) != none || Katana1_(I) != none
			|| Dagger(I) != none || Ninjato(I) != none || KatanaLLI(I) != none )
		{
			return true;
		}
	}
	
	I = Instigator.Weapon;
	
	if ( Machete(I) != none || Katana(I) != none || Katana1_(I) != none
		|| Dagger(I) != none || Ninjato(I) != none || KatanaLLI(I) != none )
	{
		return true;
	}
	
	return false;
}
/*
simulated function float RateSelf()
{
	if ( !FoundBetterMelee() )
	{
		return Super.RateSelf();
	}

	return -100;
}
*/
simulated function Weapon PrevWeapon(Weapon CurrentChoice, Weapon CurrentWeapon)
{
	if ( !FoundBetterMelee() )
	{
		return Super.PrevWeapon(CurrentChoice,CurrentWeapon);
	}
	
	if ( Inventory == None )
		return CurrentChoice;
	else
		return Inventory.PrevWeapon(CurrentChoice,CurrentWeapon);
}
simulated function Weapon NextWeapon(Weapon CurrentChoice, Weapon CurrentWeapon)
{
	if ( !FoundBetterMelee() )
	{
		return Super.NextWeapon(CurrentChoice,CurrentWeapon);
	}

	if ( Inventory == None )
		return CurrentChoice;
	else
		return Inventory.NextWeapon(CurrentChoice,CurrentWeapon);
}
simulated function Weapon WeaponChange( byte F, bool bSilent )
{
	if ( !FoundBetterMelee() )
	{
		return Super.WeaponChange(F,bSilent);
	}

	if ( Inventory == None )
		return None;
	else return Inventory.WeaponChange(F,bSilent);
}

defaultproperties
{
     weaponRange=65.000000
     BloodyMaterial=Combiner'KF_Weapons_Trip_T.melee.knife_bloody_cmb'
     BloodSkinSwitchArray=0
     bSpeedMeUp=True
     HudImage=Texture'KillingFloorHUD.WeaponSelect.knife_unselected'
     SelectedHudImage=Texture'KillingFloorHUD.WeaponSelect.knife'
     Weight=0.000000
     bKFNeverThrow=True
     StandardDisplayFOV=75.000000
     TraderInfoTexture=Texture'KillingFloorHUD.Trader_Weapon_Images.Trader_Knife'
     FireModeClass(0)=Class'KnifeFireNew'
     FireModeClass(1)=Class'KnifeFireNewB'
     SelectSound=SoundGroup'KF_KnifeSnd.Knife_Select'
     AIRating=0.200000
     CurrentRating=0.200000
     Description="Military Combat Knife"
     DisplayFOV=75.000000
     Priority=45
     GroupOffset=1
     PickupClass=Class'KnifeNewPickup'
     BobDamping=8.000000
     AttachmentClass=Class'KFMod.KnifeAttachment'
     IconCoords=(X1=246,Y1=80,X2=332,Y2=106)
     ItemName="Knife"
     Mesh=SkeletalMesh'KF_Weapons_Trip.Knife_Trip'
     Skins(0)=Combiner'KF_Weapons_Trip_T.melee.knife_cmb'
}
